package net.zoneland.knowledge.dao;

import java.util.List;

import net.zoneland.knowledge.model.BranchBrand;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;

/**
 * 支部品牌信息查询接口.
 * @author bcc
 */
@Mapper
public interface BranchBrandMapper {

    /**
     * 根据党组织id查询品牌信息.
     * @param orgUuid 党组织id
     * @return 支部品牌信息
     */
    @Select({
        "<script>",
        "select BRAND_NAME",
        "FROM AITK_BRANCH_BRAND WHERE ORG_UUID  =  #{orgUuid} ",

        "</script>"
    })
    List<String> getBranchBrandByOrgUuid(@Param("orgUuid") final String orgUuid);

    /**
     * 根据党组织id查询品牌信息.
     * @param orgUuid 党组织id
     * @return 支部品牌信息
     */
    @Select({
        "<script>",
        "select ID, ORG_UUID, BRAND_NAME, PIID ",
        "FROM AITK_BRANCH_BRAND WHERE ORG_UUID  =  #{orgUuid} ",

        "</script>"
    })
    @Results({
            @Result(column="ID", property="id", jdbcType=JdbcType.VARCHAR, id=true),
            @Result(column="ORG_UUID", property="orgUuid", jdbcType=JdbcType.VARCHAR),
            @Result(column="BRAND_NAME", property="brandName", jdbcType=JdbcType.VARCHAR),
            @Result(column="PIID", property="piid", jdbcType=JdbcType.VARCHAR),
    })
    List<BranchBrand> getBranchBrandsByOrgUuid(@Param("orgUuid") final String orgUuid);

}
